package com.itzmn.thread.test;

import javafx.beans.binding.When;

import java.util.Random;

/**
 * @Author: 张梦楠
 * @Date: 2018/11/20 10:58
 * 简书：https://www.jianshu.com/u/d611be10d1a6
 * 码云：https://gitee.com/zhangqiye
 * @Description:
 */
public class ConditionRunable implements Runnable {

    private ConditionTest conditionTest;

    private int from;

    private int max;


    ConditionRunable(ConditionTest test,int fr,int maxs){
        conditionTest = test;
        from = fr;
        max = maxs;
    }

    @Override
    public void run() {

        try {
            Random random = new Random();
            while (true){
                Thread.sleep(random.nextInt(1000));
                int i1 = random.nextInt(max);
                conditionTest.zhuanzhang(from,i1,10);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }



}
